package com.bicon.botu.config;

import com.bicon.botu.core.base.config.SystemInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 配置拦截器
 * @author tandk
 * @date 2018/7/18 14:27
 */
@Configuration
public class MvcConfig implements WebMvcConfigurer {

    @Bean
    public SystemInterceptor getMyInterceptor() {
        return new SystemInterceptor();
    }

    /**
     * 配置拦截器
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(getMyInterceptor()).addPathPatterns("/**");
    }
}
